<?php include_once('../../_inc/config.php'); ?>
<script src="../../_js/codebase/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="../../_js/codebase/dhtmlxscheduler.css" type="text/css" title="no title" charset="utf-8">
<style type="text/css" media="screen">
	html, body{
		margin:0px;
		padding:0px;
		height:100%;
		overflow:hidden;
	}	
</style>
<script type="text/javascript" charset="utf-8">
	function init() {
		
		scheduler.config.xml_date="%Y-%m-%d %H:%i";
		scheduler.config.readonly=true
	/*	scheduler.config.lightbox.sections=[	
			{name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
			{name:"location", height:43, type:"textarea", map_to:"details" },
			{name:"time", height:72, type:"time", map_to:"auto"}
		]
		scheduler.config.first_hour=4;
		scheduler.locale.labels.section_location="Location";*/
		//scheduler.config.details_on_create=true;
		//scheduler.config.details_on_dblclick=true;
		scheduler.config.multi_day = true;
<?php if (isset($_GET['id_camion'])) { ?>
	scheduler.templates.event_bar_text=function(start,end,event){
		if (event.Date_Debut)
		{
	    var start_date = event.Date_Debut.substr(10,15);
    	var end_date = event.Date_fin.substr(10,15);
		var text = event.text.substr(0,20);
        return "<b>"+start_date+"</b> - "+event.text+" - <b>"+end_date+"</b>";
		}
		else
		   return "<span title='"+event.text+"'>"+event.text+"</span>";
	}
<?php } else { ?>
	scheduler.templates.event_text=function(start,end,event){
        url = "<?php echo ABS_PATH.ROOT; ?>"+"?page=Transporteur/ShowCom&fct=Transporteur/ShowCom&idcom="+event.Id_Commande
        return "<a href='#' onClick=\"window.open('"+url+"', 'Fiche', ',type=fullWindow,fullscreen,scrollbars=yes')\" />"+event.text+"</a>";
	}
<?php } ?>
		scheduler.init('scheduler_here',null,"month");
		scheduler.load("../../_fct/Transporteur/edt.php?uid="+scheduler.uid()+"<?php if (isset($_GET['id_client'])) { echo  "&id=".$_GET['id_client']; } else { echo "&id_cam=".$_GET['id_camion']; } ?>");
		var dp = new dataProcessor("../../_fct/Transporteur/edt.php"+"<?php if (isset($_GET['id_client'])) { echo  "&id=".$_GET['id_client']; } else { echo "&id_cam=".$_GET['id_camion']; } ?>");
		dp.init(scheduler);

	}
</script>
<body onload="init();">
    <div id="scheduler_here" class="dhx_cal_container" style='w9idth:100%; height:100%;'>
		<div class="dhx_cal_navline">
			<div class="dhx_cal_prev_button">&nbsp;</div>
			<div class="dhx_cal_next_button">&nbsp;</div>
			<div class="dhx_cal_today_button"></div>
			<div class="dhx_cal_date"></div>
			<!--<div class="dhx_bbts"><a href="<?php echo ABS_PATH.ROOT; ?>?page=Transporteur/Calendar&fct=Transporteur/Calendar">Revenir au site</a></div>-->
			<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
			<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
			<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
		</div>
		<div class="dhx_cal_header">
		</div>
		<div class="dhx_cal_data">
		</div>		
	</div>
</body>